package com.zszq.ms.bigmodeltest.enums;

import lombok.Data;

/**
 * 删除标记
 *
 * @author 孟帅
 * @since 2022/9/8
 */
public enum DeleteFlagEnum {
    /**
     * 已删除
     */
    YES("1", "已删除"),

    /**
     * 未删除
     */
    NO("0", "未删除");

    /**
     * 编码
     */
    private String code;

    /**
     * 描述
     */
    private String value;

    /**
     * 构造方法
     *
     * @param code  编码
     * @param value 描述
     */
    DeleteFlagEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static DeleteFlagEnum getByCode(String code) {
        for (DeleteFlagEnum deleteFlagEnum : DeleteFlagEnum.values()) {
            if (deleteFlagEnum.getCode().equals(code)) {
                return deleteFlagEnum;
            }
        }
        return null;
    }
}
